﻿using FunArts.EasyDevOps.Shared.Models.Enums;
using FunArts.EasyDevOps.Shared.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FunArts.EasyDevOps.Shared.Models.SshClient.Command
{
    /// <summary>
    /// 停止程序命令
    /// </summary>
    public class ShutDownPorcessCommand : ILinuxCommand
    {
        public string pid { get; set; }
        public string BuildCommand(SystemVersionTypeEnum systemVersionType)
        {
            if (pid.IsNullOrWhiteSpace())
            {
                throw new Exception("进程id不能为空!");
            }
            return $"kill -9 {pid}";
        }
    }
}
